import unittest


class DemoTestCase(unittest.TestCase):

    #所有test运行前执行一次
    @classmethod
    def setUpClass(cls) -> None:
        print('开始')

    def setUp(self) -> None:
        print('每个测试方法运行前执行')

    def tearDown(self) -> None:
        print('每个测试方法运行后执行')

    def test01(self):
        print('test01')

    def test02(self):
        print('test02')

    def test03(self):
        print('test03')

    # 所有test运行后执行一次
    @classmethod
    def tearDownClass(cls) -> None:
        print('结束')

if __name__ == '__main__':
    unittest.main(verbosity=2)